<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
	<script type="text/javascript" src="../js/md5.js"></script>
	<script language="javascript" src="../js/DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script type="text/javascript" language="javascript">
		function getPwd() {
 			var pwd = document.getElementById("pwd");
 			pwd.value = hex_md5(pwd.value);
 			return true;
		}
		
		function check_repassword(){
			var re_password = $('re_pwd').value;
			var password = $('pwd').value;
			
			if(password == ''){
				//alert('密码不能为空！');
				$('pwd_msg').innerHTML = '密码不能为空！';
			}
			
			if(re_password == ''){
				//alert('密码不能为空！');
				$('re_pwd_msg').innerHTML = '密码不能为空！';
			}
			
			if(re_password != password) {
				//alert('密码不一致！');
				$('re_pwd_msg').innerHTML = '密码不一致！';
			}
		}
		
		function clear_msg(field){
			var fieldid = field.id;
			$(fieldid).value = '';
			$(fieldid + '_msg').innerHTML = '';
		}
		
		function $(fieldid){
			return document.getElementById(fieldid);
		}
	</script>
	</head>
	<body bgcolor="#ccddee" link="#000066" vlink="#0066FF" alink="#99FF00">
		<div>
			<table>
				<tr>
					<td>
						<s:fielderror cssStyle="color:red" />
					</td>
				</tr>
			</table>
		</div>
		<span style="align:left">(带<font color="red">*</font>项为必填项）</span>
		<center>
			<s:form method="post" namespace="/base" theme="simple" action="addPersonnel" validate="true"
				 onsubmit="return getPwd();">
				<table width="100%" border=1 align="center" cellpadding="0"
					cellspacing="0" bgcolor="#ccddee">
					<tr>
						<td width="15%" align="right">
							所在部门
						</td>
						<td width="30%" align="left">
							<s:select name="department.deptcode" list="deptlist" 
									listKey="deptcode" 
									listValue="deptcaption"
									headerKey="0" headerValue="请选择部门"
									theme="simple"></s:select>
						</td>
						<td align="left">
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							登录账号<font color="red">*</font>
						</td>
						<td width="30%" align="left">
							<s:textfield name="personnel.loginname" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							登录密码<font color="red">*</font>
						</td>
						<td width="30%" align="left">
							<s:password  id="pwd" name="personnel.password" theme="simple" required="true" onfocus="clear_msg(this)"></s:password>
						</td>
						<td align="left">
							<div id="pwd_msg" style="font: red"></div>
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							重复密码<font color="red">*</font>
						</td>
						<td width="30%" align="left">
							<s:password  id="re_pwd" name="password_re" theme="simple" required="true" onfocus="clear_msg(this)" onblur="check_repassword()"></s:password>
						</td>
						<td align="left">
							<div id="re_pwd_msg" style="font: red"></div>
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							真实姓名<font color="red">*</font>
						</td>
						<td width="30%" align="left">
							<s:textfield name="personnel.staffname" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							性别
						</td>
						<td width="30%" align="left">
							<s:select name="datadictBySex.typeid" list="sexDict" 
									listKey="typeid" 
									listValue="name"
									headerKey="0" headerValue="请选择"
									theme="simple"></s:select>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							出生日期
						</td>
						<td width="30%" align="left">
							<s:textfield name="personnel.birthdate" theme="simple" required="true" id="d12"></s:textfield>
							<img src="../js/DatePicker/skin/datePicker.gif" style="cursor: pointer;" onclick="WdatePicker({el:'d12'})" width="16" align="absmiddle" height="22"/>
						</td>
						<td align="left">
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							最高学历
						</td>
						<td width="30%" align="left">
							<s:select name="datadictByEdulevelcode.typeid" list="eduDict" 
									listKey="typeid" 
									listValue="name"
									headerKey="0" headerValue="请选择"
									theme="simple"></s:select>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							联系电话
						</td>
						<td width="30%" align="left">
							<s:textfield name="personnel.phone" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							手机
						</td>
						<td width="30%" align="left">
							<s:textfield name="personnel.mobile" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							email
						</td>
						<td width="30%" align="left">
							<s:textfield name="personnel.email" theme="simple" required="true"></s:textfield>
						</td>
						<td align="left">
							
						</td>
					</tr>
					<tr>
						<td width="15%" align="right">
							用户状态
						</td>
						<td width="30%" align="left">
							<s:select name="datadictByStatus.typeid" list="statusDict" 
									listKey="typeid" 
									listValue="name"
									headerKey="0" headerValue="请选择"
									theme="simple"></s:select>
						</td>
						<td align="left">
						</td>
					</tr>
				</table>
				<br />
				<br />
				<table>
					<tr>
						<td>
							<input type="submit" value=" 增 加 "/>
						</td>
					</tr>
				</table>
			</s:form>
		</center>
		<br />
		<br />
		<center>
					<span >
						第一步   添加基本信息
					</span>	
				</center>
	</body>
</html>